package net.homelinux.chaoswg.io.renga.core.gui.operations.visualisations;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.Point;
import java.awt.Rectangle;

import net.homelinux.chaoswg.io.renga.core.gui.operations.FunctionInputOperation;

public class InputBlockVisualisation extends BlockVisualisation {
    private FunctionInputOperation parent = null;
    
    public InputBlockVisualisation (final FunctionInputOperation parent) {
        super ();
        this.parent = parent;
        this.inner = Color.YELLOW;
    }
    
    public InputBlockVisualisation (final int x, final int y, final int width, final int heigtht, final FunctionInputOperation parent) {
        super (x,y,width,heigtht);
        this.parent = parent;
        this.inner = Color.YELLOW;
    }
    
    public InputBlockVisualisation (final Point position, final int width, final int height, final FunctionInputOperation parent) {
        super (position, width, height);
        this.parent = parent;
        this.inner = Color.YELLOW;
    }

    public InputBlockVisualisation (final Rectangle rect, final FunctionInputOperation parent) {
        super (rect);
        this.parent = parent;
        this.inner = Color.YELLOW;
    }
    
    public void draw (final Graphics g) {
        super.draw (g);
        g.setColor(Color.BLUE);
        String toWrite = "INPUT " +parent.getIsInputNumber() + ": " + parent.getInitialValue() ;
        g.drawString (toWrite , this.area.x + this.area.width / 2 - g.getFontMetrics().stringWidth(toWrite) / 2 + 2, this.area.y + (this.area.height / 2) + g.getFont().getSize() / 2 - 2);
        g.setColor(Color.BLACK);
    }

}
